*COMPLETE THESE RECODES ON THE DATA*
gen pid7exp=.
replace pid7exp=1 if UML726a==1 & UML726b==1

replace pid7exp=2 if UML726a==1 & UML726b==2
replace pid7exp=2 if UML726a==1 & UML726b==.

replace pid7exp=3 if UML726a==3 & UML726d==1
replace pid7exp=3 if UML726a==4 & UML726d==1
replace pid7exp=3 if UML726a==5 & UML726d==1

replace pid7exp=4 if UML726a==3 & UML726d==3
replace pid7exp=4 if UML726a==3 & UML726d==8
replace pid7exp=4 if UML726a==3 & UML726d==.
replace pid7exp=4 if UML726a==4 & UML726d==3
replace pid7exp=4 if UML726a==4 & UML726d==8
replace pid7exp=4 if UML726a==4 & UML726d==.
replace pid7exp=4 if UML726a==5 & UML726d==3
replace pid7exp=4 if UML726a==5 & UML726d==8
replace pid7exp=4 if UML726a==5 & UML726d==.

replace pid7exp=5 if UML726a==3 & UML726d==2
replace pid7exp=5 if UML726a==4 & UML726d==2
replace pid7exp=5 if UML726a==5 & UML726d==2

replace pid7exp=6 if UML726a==2 & UML726c==2
replace pid7exp=6 if UML726a==2 & UML726c==.

replace pid7exp=7 if UML726a==2 & UML726c==1

gen pureindexp=0
replace pureindexp=1 if pid7exp==4
replace pureindexp=. if pid7exp==. 

recode presvote16post (1=1 "Clinton") (2=2 "Trump") (3/6=3 "Voted for Other") (7=4 "Did not Vote"), gen(presvote16r)

*THIS CODE GENERATES FIGURE 3*
set scheme s1mono
cibar pureindexp, over(treatment_UML726) graphopts(ytitle("% of Independents identifyinging as "(pure)" independents"))

*THIS CODE GENERATES APPENDIX TABLE C2*
tab presvote16r pid7exp if treatment_UML726d==1, col
tab presvote16r pid7exp if treatment_UML726d==2, col
tab presvote16r pid7exp if treatment_UML726d==3, col